import { Space, Card, Typography } from "tdesign-react";
import HightLightCode from "@/components/HightLightCode";
import { reactMapRanderCode } from "@/config";
import "../index.less";

const { Text, Title, Paragraph } = Typography;
const Conditional = () => {
	return (
		<Card>
			<Space direction="vertical" style={{ width: "100%" }}>
				<Title level="h3">React 列表渲染</Title>
				<Paragraph>
					在React中，列表渲染是一种常见的技术，用于动态地渲染一组数据。列表渲染允许你根据数组中的数据动态生成多个组件或元素，这在构建动态用户界面时非常有用。
				</Paragraph>
				<Title level="h3">基本用法</Title>
				{reactMapRanderCode.map((item, index) => {
					return (
						<Space direction="vertical" key={index}>
							<Title level="h5">{item.title}</Title>
							<Text>{item.introduce}</Text>
							<HightLightCode code={item.code} />
						</Space>
					);
				})}
			</Space>
		</Card>
	);
};

export default Conditional;
